package week4;

import java.util.Arrays;

/**
 * Created by mc on 2017/3/18.
 */
public class test61 {
    private  Object[] list;
    private  int next;
    public  test61(int capacity){
        list = new Object[capacity];
    }
    public test61(){
        this(16);
    }
    public void add(Object o)
    {
        if(next == list.length){
            list = Arrays.copyOf(list,list.length*2);
        }
        list[next++]=o;
    }
    public Object get(int index){
        return list[index];
    }
    public int size(){
        return next;
    }
    public String toString(){
        return getClass().getName() + "@" + Integer.toHexString(hashCode());
    }
    public boolean equals(Object obj){
        return true;
    }


}

